package com.summer.data.parameter.blob;

import com.summer.data.parameter.BlobParameter;

import java.io.IOException;
import java.io.OutputStream;

/**
 * @author 345480567@qq.com
 */
public class BytesBlobParameter implements BlobParameter {

    private byte[] data;

    public BytesBlobParameter(byte[] data) {
        this.data = data;
    }

    @Override
    public void write(OutputStream outputStream) {
        try {
            outputStream.write(data);
        } catch (IOException e) {
            // todo:
            throw new RuntimeException(e);
        }
    }

    @Override
    public String toString() {
        return "BytesBlobParameter{}" + data.length;
    }
}
